package com.yj.cmp.sdk.fusioncompute.compute.vm.dto;

import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@NoArgsConstructor
@Data
public class VmDto {
    @SerializedName("autoBoot")
    private boolean autoBoot = false;

    @SerializedName("occupiedVm")
    private boolean occupiedVm = false;

    @SerializedName("securityGroupSet")
    private String securityGroupSet;

    @SerializedName("parentObjUrn")
    private String parentObjUrn;

    @SerializedName("resourceGroup")
    private String resourceGroup;

    @SerializedName("floppyFile")
    private String floppyFile;

    @SerializedName("floppyProtocol")
    private String floppyProtocol;


    @SerializedName("properties")
    private CustomPropertiesDTO properties;
    @SerializedName("description")
    private String description;

    @SerializedName("group")
    private String group;
    @SerializedName("haConfig")
    private HaConfigDTO haConfig;
    @SerializedName("isBindingHost")
    private Boolean isBindingHost;
    @SerializedName("isMultiDiskSpeedup")
    private Boolean isMultiDiskSpeedup;
    @SerializedName("location")
    private String location;
    @SerializedName("name")
    private String name;
    @SerializedName("osOptions")
    private OsOptionsDTO osOptions;
    @SerializedName("vmConfig")
    private VmConfigDTO vmConfig;

    @NoArgsConstructor
    @Data
    public static class CustomPropertiesDTO {

    }

    @NoArgsConstructor
    @Data
    public static class HaConfigDTO {
        @SerializedName("hostFaultPolicy")
        private Integer hostFaultPolicy;
        @SerializedName("vmFaultPolicy")
        private Integer vmFaultPolicy;
    }

    @NoArgsConstructor
    @Data
    public static class OsOptionsDTO {
        @SerializedName("osType")
        private String osType;
        @SerializedName("osVersion")
        private Integer osVersion;
    }

    @NoArgsConstructor
    @Data
    public static class ParamsDTO {
        @SerializedName("vmSubStatus")
        private String vmSubStatus;
        @SerializedName("parentObjUrn")
        private String parentObjUrn;
        @SerializedName("PCI_IB_CARD")
        private String pciIbCard;
    }

    @NoArgsConstructor
    @Data
    public static class VmConfigDTO {

        @SerializedName("cpu")
        private CpuDTO cpu;
        @SerializedName("disks")
        private List<DisksDTO> disks;
        @SerializedName("graphicsCard")
        private GraphicsCardDTO graphicsCard;
        @SerializedName("memory")
        private MemoryDTO memory;
        @SerializedName("nics")
        private List<NicsDTO> nics;
        @SerializedName("numaNodes")
        private Integer numaNodes;
        @SerializedName("pcis")
        private List<?> pcis;
        @SerializedName("properties")
        private PropertiesDTO properties;
        @SerializedName("usb")
        private List<UsbDTO> usb;
        @SerializedName("gpu")
        private List<GpuDTO> gpu;
        @SerializedName("gpuGroups")
        private List<GpuGroupDTO> gpuGroups;
        @SerializedName("cdromSequenceNum")
        private Integer cdromSequenceNum;


        @NoArgsConstructor
        @Data
        public static class GpuGroupDTO {
            @SerializedName("gpuGroup")
            private String gpuGroup;
            @SerializedName("count")
            private Integer count;
        }


        @NoArgsConstructor
        @Data
        public static class GpuDTO {
            @SerializedName("gpuUrn")
            private String gpuUrn;
            @SerializedName("isEffected")
            private boolean isEffected;
        }

        @NoArgsConstructor
        @Data
        public static class CpuDTO {
            @SerializedName("coresPerSocket")
            private Integer coresPerSocket;
            @SerializedName("cpuBindType")
            private String cpuBindType;
            @SerializedName("cpuHotPlug")
            private Integer cpuHotPlug;
            @SerializedName("cpuPolicy")
            private String cpuPolicy;
            @SerializedName("cpuThreadPolicy")
            private String cpuThreadPolicy;
            @SerializedName("limit")
            private Integer limit;
            @SerializedName("numaBinds")
            private List<CpuNumaBind> numaBinds;
            @SerializedName("quantity")
            private Integer quantity;
            @SerializedName("reservation")
            private Integer reservation;
            @SerializedName("weight")
            private Integer weight;
            @SerializedName("exactCpuAffinityList")
            private List<ExactCpuAffinity> exactCpuAffinityList;
            @SerializedName("affinitySet")
            private Integer[] affinitySet;

            @NoArgsConstructor
            @Data
            public static class ExactCpuAffinity {
                @SerializedName("vcpuScope")
                private Integer vcpuScope;
                @SerializedName("pcpuScope")
                private String pcpuScope;
            }

            @NoArgsConstructor
            @Data
            public static class CpuNumaBind {
                @SerializedName("nodeId")
                private Integer nodeId;
                @SerializedName("vcpus")
                private String vcpus;
            }
        }

        @NoArgsConstructor
        @Data
        public static class GraphicsCardDTO {
            @SerializedName("size")
            private Integer size;
            @SerializedName("type")
            private String type;
        }

        @NoArgsConstructor
        @Data
        public static class MemoryDTO {
            @SerializedName("hugePage")
            private String hugePage;
            @SerializedName("limit")
            private Integer limit;
            @SerializedName("memHotPlug")
            private Integer memHotPlug;
            @SerializedName("quantityMB")
            private Integer quantityMB;
            @SerializedName("reservation")
            private Integer reservation;
            @SerializedName("weight")
            private Integer weight;
            @SerializedName("unit")
            private String unit;
        }

        @NoArgsConstructor
        @Data
        public static class PropertiesDTO {
            @SerializedName("bootOption")
            private String bootOption;
            @SerializedName("vmFaultProcess")
            private String vmFaultProcess;
            @SerializedName("reoverByHost")
            private boolean reoverByHost;
            @SerializedName("clockMode")
            private String clockMode;
            @SerializedName("isEnableMemVol")
            private boolean isEnableMemVol;
            @SerializedName("isEnableFt")
            private boolean isEnableFt;
            @SerializedName("isEnableHa")
            private boolean isEnableHa;
            @SerializedName("isAutoUpgrade")
            private boolean autoUpgrade;
            @SerializedName("attachType")
            private boolean attachType;
            @SerializedName("gpuShareType")
            private String gpuShareType;
            @SerializedName("isReserveResource")
            private boolean isReserveResource;
            @SerializedName("secureVmType")
            private String secureVmType;
            @SerializedName("dpiVmType")
            private String dpiVmType;
            @SerializedName("isHpet")
            private boolean isHpet;
            @SerializedName("bootFirmware")
            private String bootFirmware;
            @SerializedName("bootFirmwareTime")
            private Integer bootFirmwareTime;
            @SerializedName("vmVncKeymapSetting")
            private Integer vmVncKeymapSetting;
            @SerializedName("cdRomBootOrder")
            private Integer cdRomBootOrder;
            @SerializedName("isAutoAdjustNuma")
            private boolean isAutoAdjustNuma;
            @SerializedName("numaAffinity")
            private Integer[] numaAffinity;
            @SerializedName("Realtime")
            private Integer[] Realtime;
            @SerializedName("emulatorPin")
            private Integer[] emulatorPin;
            @SerializedName("evsAffinity")
            private boolean evsAffinity;
        }

        @NoArgsConstructor
        @Data
        public static class DisksDTO {
            @SerializedName("pciType")
            private String pciType;
            @SerializedName("scsiCommandPassthrough")
            private boolean scsiCommandPassthrough;
            @SerializedName("sequenceNum")
            private Integer sequenceNum;
            @SerializedName("volumeUrn")
            private String volumeUrn;
            @SerializedName("volumeUrl")
            private String volumeUrl;
            @SerializedName("volumeUuid")
            private String volumeUuid;
            @SerializedName("quantityGB")
            private Integer quantityGB;
            @SerializedName("isDataCopy")
            private boolean isDataCopy;
            @SerializedName("datastoreUrn")
            private String datastoreUrn;
            @SerializedName("isThin")
            private boolean isThin;
            @SerializedName("indepDisk")
            private boolean indepDisk;
            @SerializedName("persistentDisk")
            private boolean persistentDisk;
            @SerializedName("storageType")
            private String storageType;
            @SerializedName("volType")
            private Integer volType;
            @SerializedName("maxReadBytes")
            private long maxReadBytes;
            @SerializedName("maxWriteBytes")
            private long maxWriteBytes;
            @SerializedName("maxReadRequest")
            private long maxReadRequest;
            @SerializedName("maxWriteRequest")
            private long maxWriteRequest;
            @SerializedName("type")
            private String type;
            @SerializedName("diskName")
            private String diskName;
            @SerializedName("ioWeight")
            private long ioWeight;
            @SerializedName("maxWriteBytes")
            private String datastoreName;
            @SerializedName("isCoverData")
            private boolean isCoverData;
            @SerializedName("bootOrder")
            private Integer bootOrder;
            @SerializedName("device_type")
            private String device_type;
            @SerializedName("ioMode")
            private String ioMode;
            @SerializedName("accessMode")
            private Integer accessMode;
            @SerializedName("systemVolume")
            private boolean systemVolume;
            @SerializedName("devName")
            private String devName;
            @SerializedName("volNameOnDev")
            private String volNameOnDev;
            @SerializedName("drExtParams")
            private String drExtParams;
            @SerializedName("volumeAttachStatus")
            private String volumeAttachStatus;
        }

        @NoArgsConstructor
        @Data
        public static class NicsDTO {

            @SerializedName("bootOrder")
            private Integer bootOrder;
            @SerializedName("enableSecurityGroup")
            private Boolean enableSecurityGroup;
            @SerializedName("ip")
            private String ip;
            @SerializedName("ipList")
            private String ipList;
            @SerializedName("ipv6s")
            private String ipv6s;
            @SerializedName("mac")
            private String mac;
            @SerializedName("name")
            private String name;
            @SerializedName("nicConfig")
            private NicConfigDTO nicConfig;
            @SerializedName("nicType")
            private Integer nicType;
            @SerializedName("portGroupName")
            private String portGroupName;
            @SerializedName("portGroupUrn")
            private String portGroupUrn;
            @SerializedName("portId")
            private String portId;
            @SerializedName("sequenceNum")
            private Integer sequenceNum;
            @SerializedName("uri")
            private String uri;
            @SerializedName("urn")
            private String urn;
            @SerializedName("virtIo")
            private Integer virtIo;
            @SerializedName("securityGroupId")
            private long securityGroupId;

            @NoArgsConstructor
            @Data
            public static class NicConfigDTO {
                @SerializedName("vringbuf")
                private Integer vringbuf;
                @SerializedName("queues")
                private Integer queues;
            }
        }

        @NoArgsConstructor
        @Data
        public static class UsbDTO {
            @SerializedName("controllerType")
            private String controllerType;
            @SerializedName("device")
            private List<DeviceDto> device;

            @NoArgsConstructor
            @Data
            public static class DeviceDto {
                @SerializedName("usbUrn")
                private String usbUrn;
                @SerializedName("usbHostName")
                private String usbHostName;
            }
        }
    }
}
